1. Field of the Invention
This invention relates generally to computer architecture and operating systems, and particularly to memory management in systems where the contents of memory are held in compressed form.
2. Discussion of the Related Art
In compressed-memory systems of the type considered here, the contents of main memory are held in compressed form and decompressed on cache faults. Compression occurs on cache writeback, or incoming I/O. In a system of this type, the number of logical pages in memory is generally different from that indicated by the physical size of memory. That is, the physical size may correspond to say one million pages of 4K bytes each, while the logical number may be twice as large because of the data compression. The number of logical pages will vary with the compression ratio. This ratio, in turn, is a function of the compressibility of the data, which may change quite rapidly.
Such compressed memory systems pose new problems in memory management, as the operating system must manage the number of logical pages as well as the allocation of physical space. Various prior applications, including U.S. patent application Ser. No. 09/648,681, filed Aug. 25, 2000; U.S. Pat. No. 6,279,092, issued Aug. 21, 2001; and U.S. patent application Ser. No. 09/021,333, filed Feb. 10, 1998, disclose solutions for the compressed memory management problem. The solution must include a means for allocating and deallocating pages to smoothly track the effective compression ratio, and also a means for guaranteeing that the system will not stop due to what might be termed memory bankruptcy. Here the system needs to remove some pages from memory. However, such removal may itself require additional physical space for any number of reasons, such as changes in the compressibility of data structures during the pageout process. The result can then be a system crash or hang.
The use of physical space may be due to any of the following: (a) the operating system writing into its own space, (b) a user writing into user space, or (c) the operating system writing into user space. As taught in U.S. Pat. No. 6,279,092, the disclosures of which are incorporated by reference herein, if one reserves sufficient space for (a), or alternatively leaves the operating system pages uncompressed, and stops increased memory usage due to (b), then memory bankruptcy can be prevented for systems where the operating system does not write into user space (i.e., where (c) does not occur). However, some operating systems, including Microsoft NT, do not have this property. There is a need in the art to provide a solution to this problem by preventing (c), that is preventing the operating system from writing into user space.